package org.breathe.thread.pool.common.utils;

import cn.hutool.core.util.StrUtil;
import org.springframework.core.env.Environment;

/**
 * @author: breathe
 * @createTime: 2025-04-15
 */public class CommonUtil {

    private static final String APP_NAME;

    static {
        Environment environment = ApplicationContextHolder.getEnvironment();
        String appName = environment.getProperty("spring.application.name");
        APP_NAME = StrUtil.isNotBlank(appName) ? appName : "application";
    }

    public static String getAppName() {
        return APP_NAME;
    }
}